Assert that Dependency::name is never empty, prevent 'install ""' from crashing
authorLukas Lueg <lukas.lueg@gmail.com>
Fri, 23 Mar 2018 14:26:50 +0000 (15:26 +0100)
committerLukas Lueg <lukas.lueg@gmail.com>
Fri, 23 Mar 2018 15:07:01 +0000 (16:07 +0100)
commit81ed0620bc7403df28ac211ee5a6b461e7fd16ca
tree17c16c1741631736e5ff5efeefb79953f5cfe94d
parentc157d7dd7a9f5b93b08f3335c29a883990c7fd75
Assert that Dependency::name is never empty, prevent 'install ""' from crashing

An explicit `cargo install ""` would cause clap to pass an empty crate-name,
leading to a panic(). We now assert() that Dependency::name is never the
empty string and prevent the situation in the first place by not allowing
the crate-name to be empty for `install`.

Fixes #5229
src/bin/commands/install.rs
src/cargo/core/dependency.rs
tests/testsuite/install.rs
tests/testsuite/resolve.rs